﻿<!DOCTYPE html>
<html>
<head>
   <title>Running SCANeR studio with VI-DriveSim</title>
   <meta name="generator" content="Help & Manual">
   <meta name="keywords" content="">
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <link type="text/css" href="default.css" rel="stylesheet">
   <link type="text/css" href="custom.css" rel="stylesheet">
   <script type="text/javascript" src="nsh.js"></script>
   
<!-- non-scrolling headers for CHM and browser-based help, local styles-->
<style TYPE="text/css" media="screen"> 
   <!-- 
   body {    
      margin:0; 
      padding:0; 
      overflow: auto; 
      background: #edede9; 
   } 
   #idheader { 
      width:100%; 
      height:auto; 
      padding: 0; 
      margin: 0;     
} 
    #idheaderbg  {
    background: #E40A00; 
}
#idheadernowrap  {
    white-space:nowrap; 
}
    ul {list-style-type: lower-roman}
   -->
   </style>
   
<style TYPE="text/css" MEDIA="print">
<!--
/* Hide navigation links and add space between header
     and text in the printed version. Not valid for eBooks. */
#idnav { display:none;	 }
.topichead { padding: 5px 5px 20px 5px; }
-->
</style>   
   <script type="text/javascript" src="jquery.js"></script>
   <script type="text/javascript" src="helpman_settings.js"></script>
   <script type="text/javascript" src="helpman_topicinit.js"></script>

   <script type="text/javascript">
     HMSyncTOC("index.html", "drvsim_tut_running_scaner_studio_with_vi-.htm");
   </script>
   <script type="text/javascript" src="highlight.js"></script>
   <script type="text/javascript">
     $(document).ready(function(){highlight();});
   </script>
</head>
<body>

<!--ZOOMSTOP-->

<div id="idheader" >
<div id="idheaderbg">
<table width="100%" border="0" cellspacing="0" cellpadding="0" 
       style="margin: 0px; color: #D7D7D7;">

  <tr valign="middle">
    <td align="left" valign="middle" class="topichead">
    <!--<div id="idheadernowrap">-->
    <p class="crumbs" id="idnav"><b>Navigation:</b>&nbsp;
   
   VI-DriveSim 19.2 on Linux &gt; <a href="drivesim_tut_tutorials.htm">VI-DriveSim 19.2 Tutorials</a>&nbsp;&gt;</p>
      <h1 class="p_Heading1" style="page-break-after: avoid;"><span class="f_Heading1">Running SCANeR Studio with VI-DriveSim</span></h1>

    <!--</div>-->
    </td>
    <td align="right" width="180" valign="middle" class="topichead" id="idnav">
    <div id="idheadernowrap">
    <a href="javascript: print();"
    		onmouseover="document.images.prntr.src='print_a.png'" 
        onmouseout="document.images.prntr.src='print_n.png'"
        ><img name="prntr" border="0" alt="Print this Topic" title="Print this Topic" src="print_n.png"
        ></a>&nbsp;&nbsp;
     <a href="vbk_tut_running_matlab_with_v2.htm"
        onmouseover="document.images.prev.src='back_a.png'" 
        onmouseout="document.images.prev.src='back_n.png'"
        ><img name=prev src="back_n.png" border=0 alt="Previous page"
        ></a><a href="drivesim_tut_tutorials.htm"
        onmouseover="document.images.main.src='top_a.png'" 
        onmouseout="document.images.main.src='top_n.png'"><img name=main src="top_n.png" border=0 alt="Return to chapter overview"
        ></a><a href="drvsim_tut_external_vehicle_model_using_s.htm"
        onmouseover="document.images.next.src='next_a.png'" 
        onmouseout="document.images.next.src='next_n.png'"><img name=next src="next_n.png" border=0 alt="Next page"
        ></a>
    </div>
    </td>
  </tr>
</table>
</div>

<!-- The following code displays Expand All/Collapse All links  below the header in topics containing toggles -->
  

</div>  



<div id="idcontent"><div id="innerdiv"> 
<!--ZOOMRESTART-->
<p class="p_Normal">First we must create a new test in SimWorkBench that includes the required SCANeR User Model block. To do this quickly, simply copy your default test and add the required block.</p>
<p class="p_Normal" style="text-align: center;"><img alt="drvsim_scaner_swb" width="271" height="110" style="margin:0px auto 0px auto;width:271px;height:110px;border:none" src="drvsim_scaner_swb.png"/></p>
<p class="p_Normal" style="text-align: center;"><span class="f_ImageCaption">SCANeR User Model Block</span></p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">Remember to also create a new test session for your test and save your changes. </p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">Run VI-DriveSim. In the VI-DriveSim Configuration window, find and open the iodb_scnr module. Here you can apply the settings necessary for VI-DriveSim to successfully communicate with SCANeR Studio. </p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal" style="text-align: center;"><img alt="drvsim_scaner_iodb" width="634" height="281" style="margin:0px auto 0px auto;width:634px;height:281px;border:none" src="drvsim_scaner_iodb.png"/></p>
<p class="p_Normal" style="text-align: center;"><span class="f_ImageCaption">iodb_scnr module</span></p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">Select the .rtg signals file created by SCANeR (see above: /root/Desktop/simple_udp.rtg). To choose which signals received from SCANeR are to be stored in RTDB, select the 'RTDB tool' button from the VI-DriveSim GUI, and then select the 'rtg signals' block for the same RTDB name used when creating the test in SimWorkBench. This will open a window that allows you to choose which signals to send. Remember to save any changes before closing.</p>
<p class="p_Normal">The .rtg file must be added to the SCANeR Scenario (from the <span style="font-style: italic;">Filter</span> tab) in order to enable the filter and the communication with VI-DriveSim through the <span style="font-style: italic;">RT Gateway</span> SCANeR's module, which has to be present in the used configuration.</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal" style="text-align: center;"><img alt="drvsim_scaner_rtg" width="765" height="332" style="margin:0px auto 0px auto;width:765px;height:332px;border:none" src="drvsim_scaner_rtg.png"/></p>
<p class="p_Normal" style="text-align: center;"><span class="f_ImageCaption">RTG signals selector</span></p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">Conversely, there is a set of signals that could be sent from VI-DriveSim back to SCANeR to control auxiliary vehicle functions like lights and horn.</p>
<p class="p_Normal">These channels should be manually added to RTDB as double AI points in SimulationWorkBench. You can either add all the channels, or only the ones you are going to use.</p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 24px;">The&nbsp;full&nbsp;channels&nbsp;names&nbsp;list&nbsp;which&nbsp;should&nbsp;be&nbsp;matched&nbsp;is&nbsp;reported&nbsp;below:</p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">&nbsp;</span><br />
<span class="f_CodeExample">&nbsp;</span><br />
<span class="f_CodeExample">SCNR.EVehicleLights.eLeftSignal</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">SCNR.EVehicleLights.eRightSignal</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">SCNR.EVehicleLights.eStopLights</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">SCNR.EVehicleLights.eDippedLights</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">SCNR.EVehicleLights.eMainBeam</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">SCNR.EVehicleLights.eFrontFog</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">SCNR.EVehicleLights.eBackLights</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">SCNR.EVehicleLights.eSideLights</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">SCNR.EVehicleLights.eRearFog</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">SCNR.EVehicleLights.eRearLights</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">SCNR.EVehicleLights.eDrlLeft</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">SCNR.EVehicleLights.eDrlRight</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">SCNR.Wipers.myRearWiper</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">SCNR.Wipers.myFrontWiper</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">SCNR.horn</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">SCNR.CabInput.in1</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">SCNR.CabInput.in2</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">SCNR.CabInput.in3</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">SCNR.CabInput.in4</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">SCNR.CabInput.in5</span></p>
<p class="p_CodeExample" style="page-break-inside: avoid; margin: 0px 0px 0px 72px;"><span class="f_CodeExample">&nbsp;</span></p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">Moreover, it's also possible to send back signals from VI-DriveSim directly to the SCANeR RT Gateway. These channels are received in SCANeR as Export Channels and the number and the name of them can be set in the .rtg filter from the SCANeR GUI, as reported in the following figure.</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal" style="text-align: center;"><img alt="drvsim_tutorial_scnr_rtgfilter_def" width="1157" height="624" style="margin:0px auto 0px auto;width:1157px;height:624px;border:none" src="drvsim_tutorial_scnr_rtgfilter_def.png"/></p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">In the Filter Editor menu at the tab <span style="font-style: italic;">to SCANeR</span> add the channels that has to be received from VI-DriveSim. The name of the channels must be the same as the RTDB signals and the Export channel number should be not used for other purposes, in order to avoid conflicts. </p>
<p class="p_Normal">The <span style="font-weight: bold;">iodb_scnr</span> module retrieves the channels values from the RTDB used by the Simulation Workbench test and sends them to SCANeR via UDP, which will be received as <span style="font-weight: bold;">Export Channels</span>. </p>
<p class="p_Normal">The RTDB signals that has to be retrieved must be set as <span style="font-weight: bold;">Analog Input (AI) </span>or<span style="font-weight: bold;"> Digital Input (DI)</span>. In this way the bidirectional communication with the RT Gateway SCANeR module will be established. </p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">Please make sure that the VI-CarRealTime model file selcted in the vicrt section has been created from the VI-CarRealTime GUI matching the SCANeR scenario being used. In particular initial vehicle position/orientation and road file should be defined consistently to the SCANeR experiment.</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal" style="text-align: center;"><img alt="drvsim_scaner_sendfile" width="962" height="145" style="margin:0px auto 0px auto;width:962px;height:145px;border:none" src="drvsim_scaner_sendfile.png"/></p>
<p class="p_Normal" style="text-align: center;"><span class="f_ImageCaption">vicrt .xml model file</span></p>
<p class="p_Normal" style="text-align: center;">&nbsp;</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">Run SCANeR Studio and load the scenario. Select 'Start Simulator' and then 'Play Scenario' to start the SCANeR simulation.</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal" style="text-align: center;"><img alt="drvsim_SCANeR_Setup" width="1916" height="695" style="margin:0px auto 0px auto;width:1916px;height:695px;border:none" src="drvsim_scaner_setup.png"/><span class="f_ImageCaption">SCANeR GUI</span></p>
<p class="p_Normal" style="text-align: center;">&nbsp;</p>
<p class="p_Normal"> Finally, select 'Start' from the VI-DriveSim GUI to start the VI-CarRealTime simulation. If successful, you should see the pause state is checked and the simulation time counting up. To drive, simply press 'Start'. </p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal" style="text-align: center;"><img alt="drvsim_SCANeR_success" width="402" height="35" style="margin:0px auto 0px auto;width:402px;height:35px;border:none" src="drvsim_scaner_success.png"/></p>
<p class="p_Normal" style="text-align: center;"><span class="f_ImageCaption">VI-DriveSim Successful Pause State </span></p>
<p class="p_Normal" style="text-align: center;">&nbsp;</p>
<p class="p_Normal">Stopping the SCANeR experiment while VI-DriveSim is running will trigger a stop request to VI-DriveSim. In these condition the sim status flag will move to STOPPED.</p>

<!--ZOOMSTOP-->
</div></div>
<script type="text/javascript"> 
<!-- 
var lastSlashPos = document.URL.lastIndexOf("/") >
document.URL.lastIndexOf("\\") ? document.URL.lastIndexOf("/") :
document.URL.lastIndexOf("\\");
if( document.URL.substring( lastSlashPos + 1, lastSlashPos + 4
).toLowerCase() != "~hh" )
{
    nsrInit();
}
--> 
</script> 
</body>
</html>
